/*
 * @Author: zhouting qczhouting@yonyou.com
 * @Date: 2022-11-02 15:10:48
 * @LastEditors: zhouting qczhouting@yonyou.com
 * @LastEditTime: 2022-12-05 17:41:05
 * @FilePath: \cms_pk\src\api\usedPartsReturnManage\usedPartsReturn_OEM\usedPartsNoReturn\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';

//旧件不回运
//piliangzctj 暂存重新提交
export const piliangzctj = data => axios.post(`${SERVER.CLAIMDEALER}/rPReturn/updateEnableByIds`,  null ,{params : data} );

//旧件不回运 - 主页面查询
export const getListByPage = params => axios.post(`${SERVER.CLAIMDEALER}/rPNoReturn/getListByPage`,  params );
// 审核页面
export const getNoListByPage = params => axios.post(`${SERVER.CLAIMFAC}/rPNoReturn/getListByPage`,  params );

//新增的保存
export const newSave = params => axios.post(`${SERVER.CLAIMDEALER}/rPNoReturn/saveOne`,  params );
//明细
export const selectOneById = params => axios.get(`${SERVER.CLAIMDEALER}/rPNoReturn/selectOneById/${params.nrId}` );
//旧件不回运审核
export const examineNoReturn = params => axios.post(`${SERVER.CLAIMFAC}/rPNoReturn/examineNoReturn`,  params);




//车型取得
export const getModelList = params => axios.post(`${SERVER.CLAIMDEALER}/tmModel/getModelList`, params );

// 选择旧件列表
export const getReturnListByPage = params => axios.post(`${SERVER.CLAIMDEALER}/rPCmsClaim/getPreReturnListByPage`,  params );
export const getClaimList = params => axios.post(`${SERVER.CLAIMDEALER}/rPCmsClaim/getClaimList`,  params);

export const getPartListByClaimId = params => axios.post(`${SERVER.CLAIMDEALER}/rPNoReturn/getPartListByClaimId`,  params);
export const submitOne = params => axios.post(`${SERVER.CLAIMDEALER}/rPNoReturn/submitOne`,  params);

//导出
export const getListForExport = params => {
  const url = `${SERVER.CLAIMFAC}/rPNoReturn/getListForExport`;
  return axios({
    url,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};
//通过ID查
export const selectById = params => axios.get(`${SERVER.CLAIMDEALER}/rPReturn/selectByIdNew/${params.id}`);

//导出模版
export const downloadModel = params => {
  const url = `${SERVER.CLAIMDEALER}/rPReturn/exportModel`;
  return axios({
    url,
    method: 'post',
    responseType: 'blob'
  });
};

//一般车辆配件类型保修期编辑弹窗的保存
export const editSave = params => axios.post(`${SERVER.CLAIMDEALER}/rPReturn/updateByPtId`,  params );
export const getListForExportNew = (params) => axios.post(`${SERVER.CLAIMDEALER}/rPReturn/getListForExport`, params, {
  responseType: 'blob'
});







